/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.constants;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * The Class PagePathCalculator.
 */
public class PagePathCalculator {
	
	
	
	/**
	 * 后台模板
	 */
	public static String backEndTemplet = "/amaze";
	
	/**
	 * 后台文件路径，放在admin插件中
	 */
	private static String backEndPath =  backEndTemplet;
	
	/**
	 * 计算后台页面所在位置.
	 * 
	 */
	public static String calculateBackendPath(HttpServletRequest request, HttpServletResponse response, String pathValue,
			PageDefinition pageDefinition) {
		return backEndPath + pathValue;
	}
	
	/**
	 * 计算公共页面的路径
	 * 
	 */
	public static String calculateCommonPath(String pathValue) {
		return  pathValue;
	}

	
	/**
	 * 计算Action的路径
	 * 
	 * @param actionType
	 *            the action type
	 * @param pathValue
	 *            the path value
	 * @return the string
	 */
	public static String calculateActionPath(String actionType, String pathValue) {
		return actionType + pathValue;
	}


	/**
	 * 后台还保留tiles方式调用，前台已经全部采用jsp
	 * @param request
	 * @param response
	 * @param path
	 * @param pageDefinition
	 * @return
	 */
	public static String calculateAdminTilesPath(HttpServletRequest request, HttpServletResponse response, String path,
			PageDefinition pageDefinition) {
		return path + "amaze";
	}


}
